package com.learn.worksession.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @program: loginproject
 * @description
 * @author: luffy
 * @create: 2020-08-13 00:30
 */
@Configuration
public class MyWebAppConfig extends WebMvcConfigurationSupport {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new RequestInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login/**","/error")
                .excludePathPatterns("/css/**")
                .excludePathPatterns("/js/**");
        super.addInterceptors(registry);
    }
}
